package  swf
{
	import flash.system.Capabilities;
	import flash.ui.Multitouch;
	/**
	 * ...
	 * @author FireKnight
	 */
	public final class SwfRunTime 
	{
		public static const DESKTOP:String = "AIR运行环境";
		public static const PlugIn:String = "HTML运行环境";
		public static const StandAlone:String = "独立的FLASHPLAYER";
		public static const ActiveX:String = "IE控件";
		public static const External:String = "外部flashPlayer或调试模式";
		public function SwfRunTime() 
		{
			
		}
		
		public static function get screenType():String
		{
			if(Multitouch.maxTouchPoints>1)
			{
				return "finger";
			}
			else
			{
				return "mouse";
			}
		}
		
		public static function get maxTouchPoints():uint
		{
			if(Multitouch.maxTouchPoints>1)
			{
				return Multitouch.maxTouchPoints;
			}
			else
			{
				return 1;
			}
		}
		
		public static function screenSize():String
		{
			return flash.system.Capabilities.screenResolutionX+"x"+flash.system.Capabilities.screenResolutionY;
		}
		
		public static function os():String
		{
			return flash.system.Capabilities.os;
		}
		
		public static function version():String
		{
			return Capabilities.version;
		}
		
		/**
		 * 
		 * @return  DESKTOP = "AIR运行环境";
					PlugIn = "HTML运行环境";
					StandAlone = "独立的FLASHPLAYER";
					ActiveX = "IE控件";
					External = "外部flashPlayer或调试模式";
		 */
		public static function runtime():String
		{
			switch (flash.system.Capabilities.playerType)
			{
				case "StandAlone":
						return StandAlone;
						break;
					case "PlugIn":
						return PlugIn;
						break;
					case "Desktop":
						return DESKTOP;
						break;
					case "ActiveX":
						return ActiveX;
						break;
					case "External":
						return External;
						break;	
			}
			return "";
		}
		
		
	}

}